#include "ProcessPool.hpp"

void Usage(std::string proc)
{
    std::cout << "Usage: " << proc << " process-num" << std::endl;
}

//我们自己就是主进程
int main(int argc,char* argv[])
{
    if(argc != 2)
    {
        Usage(argv[0]);
        return 1;
    }
    int num = std::stoi(argv[1]);
    std::vector<Channel> channels;
    //1.初始化进程池
    InitProcessPool(num,channels,Worker);
    //2.派发任务
    DispatchTask(channels);
    //3.退出子进程
    CleanProcessPool(channels);

    return 0;
}